﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Data;

namespace WcfGeebaServer
{
    public class SubscribersType
    {
        public string Username { get; set; }
        public string SessionId { get; set; }
        public IListener Listener { get; set; }
        public ISListener SListener { get; set; }

        // override object.Equals
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            SubscribersType other = ((SubscribersType)obj);

            return other.Username == Username && other.SessionId == SessionId && (other.Listener == Listener || other.SListener == SListener);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}